package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * MainpointCertificate generated by hbm2java
 */
@Entity
@Table(name = "mainpoint_certificate")
public class MainpointCertificate implements java.io.Serializable {

	private Long id;
	private Student student;
	private UserBaseInfo userBaseInfo;
	private String certificateNum;
	private Integer printNum;
	private Date releaseDate;
	private Date startDate;
	private Date endDate;
	private Set<MainPoint> mainPoints = new HashSet<MainPoint>(0);

	public MainpointCertificate() {
	}

	public MainpointCertificate(Student student, UserBaseInfo userBaseInfo,
			String certificateNum, Integer printNum, Date releaseDate,
			Date startDate, Date endDate, Set<MainPoint> mainPoints) {
		this.student = student;
		this.userBaseInfo = userBaseInfo;
		this.certificateNum = certificateNum;
		this.printNum = printNum;
		this.releaseDate = releaseDate;
		this.startDate = startDate;
		this.endDate = endDate;
		this.mainPoints = mainPoints;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STUDENT_ID")
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SIGNER_ID")
	public UserBaseInfo getUserBaseInfo() {
		return this.userBaseInfo;
	}

	public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
		this.userBaseInfo = userBaseInfo;
	}

	@Column(name = "CERTIFICATE_NUM", length = 10)
	public String getCertificateNum() {
		return this.certificateNum;
	}

	public void setCertificateNum(String certificateNum) {
		this.certificateNum = certificateNum;
	}

	@Column(name = "PRINT_NUM")
	public Integer getPrintNum() {
		return this.printNum;
	}

	public void setPrintNum(Integer printNum) {
		this.printNum = printNum;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "RELEASE_DATE", length = 19)
	public Date getReleaseDate() {
		return this.releaseDate;
	}

	public void setReleaseDate(Date releaseDate) {
		this.releaseDate = releaseDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "START_DATE", length = 19)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "END_DATE", length = 19)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "mainpoint_certificate_mainpoint", joinColumns = { @JoinColumn(name = "mainpoint_certificate_id", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "mainpoint_id", nullable = false, updatable = false) })
	public Set<MainPoint> getMainPoints() {
		return this.mainPoints;
	}

	public void setMainPoints(Set<MainPoint> mainPoints) {
		this.mainPoints = mainPoints;
	}

}
